package com.hsxxherp.simplify.framework.handler;


import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
import com.hsxxherp.simplify.framework.centext.holdor.TenantHolder;
import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.StringValue;

/**
 * Mybatis Plus 多租户实现
 *
 * @author Mark·虎克 （2486970363@qq.com）
 */
public class TenantHandler implements TenantLineHandler {
    @Override
    public Expression getTenantId() {
//        String tenantId = TenantHolder.getTenantId();
        String tenantId = "TenantHolder.getTenantId()";
        return new StringValue(tenantId);
    }

    @Override
    public String getTenantIdColumn() {
        return "tenant_id";
    }
}
